package cn.maxxieyi.aichatbot.dto;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.util.List;
@Data
public class LinkAiChatResponse extends AiChatResponse {

    private List<ChoiceVO> choices;

    private UsageVO usage;

    private AgentVO agent;

    private ErrorVO error;

    @Data
    public static class ChoiceVO {

        private MessageVO message;
        @Data
        public static class MessageVO{

            /**
             * 响应中的role一般固定为 assistant
             */
            private String role;
            /**
             * 回复的文本
             */
            private String content;

        }
    }

    @Data
    public static class UsageVO {

        @JSONField(name = "prompt_tokens")
        private Integer promptTokens;

        @JSONField(name = "completion_tokens")
        private Integer completionTokens;

        @JSONField(name = "total_tokens")
        private Integer totalTokens;
    }

    @Data
    public static class AgentVO {

        private String chain;

        @JSONField(name = "need_show_plugin")
        private String needShowPlugin;

        @JSONField(name = "need_show_thought")
        private String needShowThought;
    }

    @Data
    public static class ErrorVO {

        private String message;

        private String code;

        private String type;
    }
}
